<?php session_start();
//error_reporting(0);
//get the q parameter from URL
$task = $_GET['task'];

$xml = "http://cp.jeth-ro.com/RSS/".$task.".php?task=".$task."&sid=".rand(1,100000);

$xmlDoc = new DOMDocument();
$xmlDoc->load($xml);

$channel=$xmlDoc->getElementsByTagName('channel')->item(0);
$channel_title = $channel->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;
$channel_link = $channel->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeValue;
$channel_show = $channel->getElementsByTagName('show')->item(0)->childNodes->item(0)->nodeValue;
$data = '';
if($task == "pvpladder5"){
	$x=$xmlDoc->getElementsByTagName('item');
	for ($i=0; $i<$channel_show; $i++){
	  $title = $x->item($i)->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;
	  $link = $x->item($i)->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeValue;
	  #echo ($i+1).". <a href='" . $link . "' target='_blank'>" . $title . "</a><br />";
	  $data .= '<li><a href="'.$link.'" target="_blank">'.$title.'</a></li>';
	}
	if(!isset($_SESSION['top5pvpladder'])) $_SESSION['top5pvpladder'] = $data;
	echo $data;
	
}	
?>